import { Injectable } from "@nestjs/common";
import * as system from "systeminformation";

@Injectable()
export class DeviceService {
    cpuInfo() {
        return system.cpu();
    }

    cpuUsage() {
        return system.currentLoad();
    }

    processes() {
        return system.processes();
    }

    memory() {
        return system.mem();
    }

    fsSize(drive?: string) {
        return system.fsSize(typeof drive != "string" ? "" : drive);
    }

    osInfo() {
        return system.osInfo();
    }
}
